﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace JBookStore.Helpers
{
    public static class AppHelper
    {
        //返回Content的虚拟目录
        public static string ContentRoot
        {
            get
            {
                string contentVirtualRoot = "~/Content";
                return VirtualPathUtility.ToAbsolute(contentVirtualRoot);
            }
        }

        //返回Images的虚拟目录
        public static string ImageRoot
        {
            get
            {
                return string.Format("{0}/{1}", ContentRoot, "Images");
            }
        }

        //返回Css的虚拟目录
        public static string CssRoot
        {
            get
            {
                return string.Format("{0}/{1}", ContentRoot, "Css");
            }
        }

        //建立图片url
        public static string ImageUrl(string imageFile)
        {
            return string.Format("{0}/{1}", ImageRoot, imageFile);
        }

        //建立Cssurl
        public static string CssUrl(string cssFile)
        {
            return string.Format("{0}/{1}", CssRoot, cssFile);
        }

        public static bool UserIsLoggedIn()
        {
            return false;
        }

        public static string GetUserName()
        {
            return null;
        }
    }
}
